﻿<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<HEAD>

    <META content="IE=11.0000"
          http-equiv="X-UA-Compatible">
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <TITLE>投票列表</TITLE>
    <LINK href="/vote/css/style.css" rel="stylesheet" type="text/css">
    <META name="GENERATOR" content="MSHTML 11.00.10586.420">
    <script src="/vote/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $(".aa").hide();
            $(".cc").hide();
            $("#tain").click(function () {
                if($(this).text()=="维护"){
                    $(this).text("取消维护");
                    $(".bb").hide();
                    $(".aa").show();
                    $(".cc").show();
                }else{
                    $(this).text("维护");
                    $(".bb").show();
                    $(".aa").hide();
                    $(".cc").hide();
                }

            });
        })
        function ddel(a) {
            $(a).parent().parent().remove();
        }
    </script>
</HEAD>
<BODY>
<DIV class="wrap" id="header"><IMG src="/vote/images/logo.gif"></DIV>
<DIV class="wrap" id="navbar">
    <DIV class="profile">您好,<span th:text="${session.user}"></span>
        <SPAN class="return"><A href="/vote/show/1/null">返回列表</A></SPAN>
        <SPAN class="addnew"><A href="/vote/ad" th:if="${session.user=='admin'?true:false}">添加新投票</A></SPAN>
        <SPAN class="modify"><A id="tain" th:if="${session.user=='admin'?true:false}">维护</A></SPAN>
        <SPAN class="return"><A href="/vote/cancellation">注销</A></SPAN></DIV>
    <DIV class="search">
        <FORM action="/vote/show2/1" method="post">
            <INPUT name="title" class="input-text" type="text" th:value="${title}">
            <INPUT name="submit" class="input-button" type="submit" value=""/>
        </FORM>
    </DIV>
</DIV>
<DIV class="wrap" id="vote">
    <H2>投票列表</H2>
    <DIV style="float: right;">
        <A th:href="'/vote/show/1/'+${title eq ''?'null':title}">首页</A>
        <A th:href="@{'/show/'+${index-1}+'/'+${title eq ''?'null':title}}">上一页</A>
        <A th:href="'/vote/show/'+${index+1}+'/'+${title eq ''?'null':title}">下一页</A>
        <A th:href="'/vote/show/'+${last}+'/'+${title eq ''?'null':title}">末页</A>
    </DIV>
    <BR>
    <UL class="list">

        <LI class="odd" th:each="e:${page.records}">
            <H4>
                <A  th:href="'/vote/view/'+${e.sid}" th:text="${e.title}"></A>
            </H4>
            <DIV class="join">
                <A th:href="'/vote/upd/'+${e.title}" class="aa">维护</A>
                <A th:href="'/vote/del/'+${e.sid}" onclick="ddel(this)" class="cc">删除</A>
                <A th:href="'/vote/vote1/'+${e.sid}" class="bb">我要参与</A>
            </DIV>
            <P class="info" th:text="'共有' +${e.ccount} +'个选项，已有 '+${e.icount}+' 次投票。'"></P>
        </LI>

    </UL>
    <DIV style="float: right;">
        <A th:href="'/vote/show/1/'+${title eq ''?'null':title}">首页</A>
        <A th:href="@{'/show/'+${index-1}+'/'+${title eq ''?'null':title}}">上一页</A>
        <A th:href="'/vote/show/'+${index+1}+'/'+${title eq ''?'null':title}">下一页</A>
        <A th:href="'/vote/show/'+${last}+'/'+${title eq ''?'null':title}">末页</A>
    </DIV>
</DIV>
<DIV class="wrap" id="footer"> 北大青鸟 © 版权所有</DIV>
</BODY>
</HTML>
